Repository navigation
fix(fs): follow final link under linked dirs; slash keys for implicit parents - #2841
Merged
Merged
Conversation
Review verdictAcceptable — revised Findings (0 new)
What changed since last review (
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Михайло · project thread
What changed
>) or fail (>>) #2829: writing to a link inside a symlinked directory (> dl/linkwithdl -> sub,sub/link -> ../file) now writes the link's target. Before,>silently replacedsub/linkwith a regular file and>>failed with "No such file or directory". The write path now resolves the final component even when the innerstatfailed on a parent link, matching theFollowFsmodule contract ("writes never replace a link with a file").mkdir -pandadd_file/add_dirkey implicit parent directories with\#2830:mkdir -p,InMemoryFs::add_file,add_dirandadd_lazy_filebuild implicit parent keys withvfs_joininstead ofPathBuf::push, sosnapshot()on Windows no longer exposes/tmp\a-style paths.Thanks @CameronTofer for both reports and the suggested patches.
Why
Both were reported by a downstream user with repros on 0.20.3. #2829 silently corrupts the link graph; #2830 loses every
mkdir -pdirectory for callers that map snapshot paths back.Before / After
#2829 (new spec case
symlink_write_through_link_in_linked_dir, expectation checked against real bash):#2830: new
windows_containment_implicit_parents_use_slash_keysasserts no\in entry keys; it runs in the existing Windows containment CI job (the bug is invisible on Unix hosts).Local:
cargo test -p bashkit --lib fs::224 → 226 pass (the #2829 unit test failed before the fix), bash spec suite green, clippy clean.Risk
statalready failed.Checklist
Closes #2829
Closes #2830